package Test.ThirdFour;


public class Triangle extends Shape {
    private int length;
    private int high;
    private int n;
    /**
     * 无参数构造器
     * 默认：长5 宽4
     */
    public Triangle(){
        length=5;
        high=4;
        n=3;
    }
    /**
     *带参数构造器
     * @param l 长
     * @param w 宽
     */
    public Triangle(int l,int w){
        this.length=l;
        this.high=w;
        n=3;
    }

    /**
     * 实现继承的抽象类中抽象方法
     * @return
     */
    @Override
    public int area(){
        return (length*high)/2;
    }

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public int getHigh() {
        return high;
    }

    public void setHigh(int high) {
        this.high = high;
    }
}
